﻿using TUIO;

namespace MTBrainStorm.Multitouch.Input.Providers.Listeners
{
    internal class TuioInputProviderListener : TuioListener
    {
        #region cursor events

        public delegate void CursorAddedHandler(TuioCursor tCur);

        public delegate void CursorRemovedHandler(TuioCursor tCur);

        public delegate void CursorUpdatedHandler(TuioCursor tCur);

        public event CursorAddedHandler CursorAdded;

        protected virtual void OnCursorAdded(TuioCursor tCur)
        {
            if (CursorAdded != null)
                CursorAdded(tCur);
        }

        public event CursorUpdatedHandler CursorUpdated;

        protected virtual void OnCursorUpdated(TuioCursor tCur)
        {
            if (CursorUpdated != null)
                CursorUpdated(tCur);
        }

        public event CursorRemovedHandler CursorRemoved;

        protected virtual void OnCursorRemoved(TuioCursor tCur)
        {
            if (CursorRemoved != null)
                CursorRemoved(tCur);
        }

        #endregion

        #region TuioListener interface implementation

        public void addTuioObject(TuioObject tobj)
        {
        }

        public void updateTuioObject(TuioObject tobj)
        {
        }

        public void removeTuioObject(TuioObject tobj)
        {
        }

        public void addTuioCursor(TuioCursor tcur)
        {
            OnCursorAdded(tcur);
        }

        public void updateTuioCursor(TuioCursor tcur)
        {
            OnCursorUpdated(tcur);
        }

        public void removeTuioCursor(TuioCursor tcur)
        {
            OnCursorRemoved(tcur);
        }

        public void refresh(TuioTime ftime)
        {
        }

        #endregion
    }
}